package com.intel.factorytest.activity;

import com.intel.factorytest.R;

import android.app.Activity;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.provider.MediaStore;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class CallSystemCamera extends BaseActivity {
    
    private static final int REQ_CODE_SYSCAMERA = 1;
    
    private TextView sysCameraTv;
    

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        
        setContentView(R.layout.system_camera_call_layout);
        initView();
        
        Intent sysCameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);  
        startActivityForResult(sysCameraIntent, REQ_CODE_SYSCAMERA);
//        startActivity(sysCameraIntent);
    }
    
    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        System.out.println("tangjun onActivityResult:" + resultCode);
        if (requestCode == REQ_CODE_SYSCAMERA) {
            if (resultCode == RESULT_OK) {
                is_pass = true;
                finish();
            } else {
                is_pass = false;
                finish();
            }
        }
    }
    
    protected void initView() {
        super.initView();
        sysCameraTv = (TextView) findViewById(R.id.systemCameraCallTextView);
    }
    
    @Override
    public void finish() {
        tc.setTestResult(is_pass);
        super.finish();
    }
}
